<?php

namespace frontend\modules\share\controllers;

use Yii;
use frontend\components\Controller;
use common\helpers\Url;
use common\helpers\ArrayHelper;
use common\logics\ShareLogic;

/**
 * 常见问题与帮助分类接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DefaultController extends Controller {

    public $closeCheckAuthent = true;

    /**
     * {@inheritdoc}
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    /**
     * 问题与帮助分类列表
     * @inheritdoc
     */
    public function actionIndex() {
        $params = Yii::$app->request->get('data');
        if ($params) {
            return ShareLogic::parseData($params);
        }
        return null;
    }

    /**
     * 问题与帮助分类列表
     * @inheritdoc
     */
    public function actionIndex2() {
        $queryParams = Yii::$app->request->queryParams;
        $params = ArrayHelper::remove($queryParams, 'd');
        if ($params) {
            return ShareLogic::parseData($params);
        }
        return $queryParams;
    }

}
